(function (_super) {
    function QuickStart() {
        QuickStart.super(this);

        this.init();
    }
    Laya.class(QuickStart, "Com.Matching.QuickStart", _super);
    var _proto = QuickStart.prototype;
    _proto.init = function () {
        this.centerX = 0;
        this.alpha = 0;
        this.bottom = - this.height;
        
        var mask = new Laya.Sprite();
            mask.loadImage("res/public/avatar_mask.png", 0, 0, this.avatar.width, this.avatar.height);

        this.avatar.mask = mask;
        this.expNum.width = 0;

        this.btnQuick.on(Laya.Event.CLICK, this, function () {
            ppt.io.emit({"cmd" : "pvp::wait", params : {"type" : 0}});
        });
    }
    _proto.update = function (data) {
        this.avatar.skin = data.avatar == "" ? USER_DEFAULT_AVATAR : data.avatar;

        this.userName.text = utils.cutStr(data.name, 10);
        this.level.text = "lv:" + data.lvl;
        this.exp.text = data.exp + "/" + data.nextExp;

        var progress = data.exp / data.nextExp;
        if(data.exp == 0){
            this.expNum.visible = false;
        }else{
            this.expNum.visible = true;
            this.expNum.width = progress * 234;
        }
    }
    _proto.enter = function () {
        Laya.Tween.to(this, {bottom : 6, alpha : 1}, 300);
    }
    _proto.resize = function (height) {
        Laya.Tween.clearAll(this);

        this.alpha = 1;
        this.bottom = 6;
    }
})(ui.Matching.QuickStartUI);